<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  
<%@page import="java.util.List"%>
<%@page import="gamble.notice.vo.BoardVO"%>
<%@page import="gamble.notice.vo.PageVO"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js 
"></script>
<script type="text/javascript">
$(document).ready(function(){
	$('.write').css({"visibility":"hidden"});
	$(".admin").bind("click",function(){
		
		 $('.write').css({"visibility":"visible"});
	 });
	
});
 </script>
<script language="JavaScript" type="text/JavaScript">
function popup()
{
window.open ("pop/popup.jsp", "divpop1", "location=no,width=350,height=550,scrollbars=no,toolbar=no,top=0,left=0,resizable=no");


}

</script>
 
<title>공지사항 리스트</title>
</head>
<body onLoad="javascript:popup();" bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- <body onLoad="javascript:btn();"> -->
 <table>
<tr><td><input type="button" class="admin" value="내가 관리자"></td></tr>
</table>
 
 <table border="1" width="750" bordercolor="#1234" style="border-collapse: collapse;" >
   <hr board="1">
   <tr bgcolor="yellow">
     <th>번호</th><th>제목</th><th>조회수</th><th>글쓴이</th>
   </tr>
   

      <c:forEach var="list" items="${list}">
    	<tr >
    	 <td  align="center" width="50" bgcolor="gold"><c:out value="${list.num}"/></td>
    	  <td >&nbsp;
    	  <c:if test="${list.re_level>0}">
    	   <img src='images/level.gif' width="${list.re_level*8}"/>	  
    	   <img src='images/re.gif'/>
    	  </c:if>
    	     		  
    	  <a href="view.htm?currentPage=${pv.currentPage}&num=${list.num}" onfocus='blur()'>
    	        ${list.subject}</a>
    	  
    	  <c:if test="${list.readcount>=5}">
    		 <img src='images/hot.gif'/>    
    		 </c:if>	  
    	  </td>
    	  <td align="center" width="70" bgcolor="bluesky">${list.readcount}</td>
    	  <td align="center" width="100">${list.writer}</td> 
    	  </tr>
     
      </c:forEach> 
 </table>
<table border="0" width="750" >
<tr>
<td align="center">
   <c:choose>   
    <c:when test="${pv.currentPage<=pv.blockPage}">
    	<c:out value="이전" />
    </c:when> 
    
    <c:otherwise>    	
    	<c:set var="currentPage" value="${pv.startPage-pv.blockPage}"/>    	
       <a href="list.htm?currentPage=${currentPage}">이전</a>
    </c:otherwise>
     </c:choose> 
     
     <c:forEach var="i"  begin="${pv.startPage}" end="${pv.endPage}">
        	<a href="list.htm?currentPage=${i}">${i}</a>
   </c:forEach>
    
    <c:choose>
    <c:when test="${pv.endPage==pv.totalPage}">
    	<c:out value="다음"/>
    </c:when>    
    
    <c:otherwise>
    <c:set  var="currentPage" value="${pv.startPage+pv.blockPage}"/>  
    	
    	<a href="list.htm?currentPage=${currentPage}">다음</a> 	
   </c:otherwise>
   
   </c:choose>
</td>
 </tr>
 <tr>
  <td align="right">
   <form name="frm" action="write.htm" >
<%--   <%  String id=request.getParameter("writer");
		String admin="admin"; 
    if(id.equals(admin)){
 %> --%>
 <input type="submit" value="글쓰기" id="ad" class="write"/>
<%--  <%
 	}else{
 		%>
<input type="hidden" value="글쓰기" id="ad" class="admin"/>
	<%	
 	}
  %>
   --%>
 </form>
  	
  </td>   
   </tr>
  </table>
</body>
</html>